package com.example.airole.common.entity;

import lombok.AllArgsConstructor;
import lombok.Getter;

/**
 * 响应状态码枚举
 */
@Getter
@AllArgsConstructor
public enum ResponseCode {
    
    // 成功
    SUCCESS(200, "操作成功"),
    
    // 客户端错误
    BAD_REQUEST(400, "请求参数错误"),
    UNAUTHORIZED(401, "未授权"),
    FORBIDDEN(403, "禁止访问"),
    NOT_FOUND(404, "资源不存在"),
    METHOD_NOT_ALLOWED(405, "请求方法不允许"),
    CONFLICT(409, "资源冲突"),
    VALIDATION_ERROR(422, "参数验证失败"),
    
    // 服务器错误
    ERROR(500, "服务器内部错误"),
    SERVICE_UNAVAILABLE(503, "服务不可用"),
    
    // 业务错误码
    USER_NOT_FOUND(1001, "用户不存在"),
    USER_ALREADY_EXISTS(1002, "用户已存在"),
    INVALID_CREDENTIALS(1003, "用户名或密码错误"),
    TOKEN_EXPIRED(1004, "令牌已过期"),
    TOKEN_INVALID(1005, "令牌无效"),
    
    // AI服务相关错误码
    AI_SERVICE_ERROR(2001, "AI服务异常"),
    SPEECH_RECOGNITION_ERROR(2002, "语音识别失败"),
    TTS_ERROR(2003, "语音合成失败"),
    LLM_ERROR(2004, "大语言模型调用失败"),
    AUDIO_FORMAT_ERROR(2005, "音频格式不支持"),
    AUDIO_SIZE_EXCEEDED(2006, "音频文件过大"),
    
    // 对话相关错误码
    CONVERSATION_NOT_FOUND(3001, "对话不存在"),
    CONVERSATION_EXPIRED(3002, "对话已过期"),
    MESSAGE_TOO_LONG(3003, "消息内容过长"),
    ROLE_NOT_FOUND(3004, "角色不存在"),
    
    // 文件相关错误码
    FILE_UPLOAD_ERROR(4001, "文件上传失败"),
    FILE_FORMAT_ERROR(4002, "文件格式不支持"),
    FILE_SIZE_EXCEEDED(4003, "文件大小超限"),
    FILE_NOT_FOUND(4004, "文件不存在");
    
    private final Integer code;
    private final String message;
}

